UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GAGvtDL0jRlgTdHftrIrDdbY8plhRYJWVRm6tTEGXJY='
WHERE
key_id = 'aecc8eacd5b709d6637b50fb81858162371041d2aa29b722025bd0c813683017'
AND (
token = 'GAGvtDL0jRlgTdHftrIrDdbY8plhRYJWVRm6tTEGXJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)