UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6wwz+aqmOAvo+ivmkIYGFSS/hKcVggM+Wt/A7FnPV4E='
WHERE
key_id = 'e9cfa11b5973d4f2c36df144e51f67ad20f005c5257809662fac681616d56a44'
AND (
token = '6wwz+aqmOAvo+ivmkIYGFSS/hKcVggM+Wt/A7FnPV4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)