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