UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9QWNFcPAAX0U0NCtJQ1UOEFiL6KURdm4O2Eb0/Mvl9s='
WHERE
key_id = 'b6419ff3ba0f7e9e002826e336f365af08720f18511f07665cafe0da67103839'
AND (
token = '9QWNFcPAAX0U0NCtJQ1UOEFiL6KURdm4O2Eb0/Mvl9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)