UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd0rRQf0L6c+4goZqp21uSedLne4gm58zCUKkve5dkjc='
WHERE
key_id = '2fa3e4f8e931e58d4aec22c3a34f59d3bfe88d6c660f2ff769d94f50e6941b8f'
AND (
token = 'd0rRQf0L6c+4goZqp21uSedLne4gm58zCUKkve5dkjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)