UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7BTOJmTURZzq968MWiwqy3j2JDsGOg3X1QHW5OUHXiM='
WHERE
key_id = 'e76e95dba67621cef6af471add492fd478b02c4ef501e4cc020b1bbf2f1a63e9'
AND (
token = '7BTOJmTURZzq968MWiwqy3j2JDsGOg3X1QHW5OUHXiM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)