UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6r3xWw6nMB2XW7UKcOFH6C9w4+jFYzdToymnOTegJV0='
WHERE
key_id = 'ef2ee85934f8a90833c22969c4dbc4aa4c954c93204b90a4784246c4bc0192da'
AND (
token = '6r3xWw6nMB2XW7UKcOFH6C9w4+jFYzdToymnOTegJV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)