UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'my7cKVu/2p2PcOywiTWQ68uHAOeWiJGshXYM3rWS8u0='
WHERE
key_id = 'd6d8ee07bb0b4192832ec0eb3e660bc6367feeaaef1557bbbdc127f6e77d4f63'
AND (
token = 'my7cKVu/2p2PcOywiTWQ68uHAOeWiJGshXYM3rWS8u0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)