UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NXmQ/4ihekmnveiwe8vkQgV8ONfZlYbaKrhSnFBHuCo='
WHERE
key_id = '2a6b001c88f340b46f7f4ab1d753ab32020c91588d8de0191e18de16f9a8ab13'
AND (
token = 'NXmQ/4ihekmnveiwe8vkQgV8ONfZlYbaKrhSnFBHuCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)