UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8BJRRCVNVoTOOzblcnakiFnkJF8mXWg3MWnAMuaVzro='
WHERE
key_id = 'dee3e6c5b1f9ab7143cd4c7c2f449ac82f1c8d4c6c5e06b23df9a629a10f59ac'
AND (
token = '8BJRRCVNVoTOOzblcnakiFnkJF8mXWg3MWnAMuaVzro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)