UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fnvgz49wh0JsRBHLhd1xErr33+KXclMCptBb/f/MfOs='
WHERE
key_id = 'cb017072b0e05efc89a26ab709b7f483b8fc1609b7de1f44bb303d71ac9482e6'
AND (
token = 'Fnvgz49wh0JsRBHLhd1xErr33+KXclMCptBb/f/MfOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)