UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hdyMeJvYJ5PcLPRGe+zzNLIitSnIFN6ZDhSjrvFhVTQ='
WHERE
key_id = '25c089eb2a4eac0e40e324abb2a131e12888185079a4f72690dc07d82a25ea91'
AND (
token = 'hdyMeJvYJ5PcLPRGe+zzNLIitSnIFN6ZDhSjrvFhVTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)