UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xJmAHStrivlgoi+fSWGTOkyMjhmZPoYn3I3s8hzfG1A='
WHERE
key_id = '2f6aae2b0536917f09812f40fcbc39f68b5303bb192df4f0c648e978a6244e9e'
AND (
token = 'xJmAHStrivlgoi+fSWGTOkyMjhmZPoYn3I3s8hzfG1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)