UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JJeITB5wHxiohAquFYLMUee7awnFSNYpmqQDZiSYyvc='
WHERE
key_id = 'e44b11266b6f4a241cc34aae20120306dc5510c54b69cd9914f9d476fe1c7ef3'
AND (
token = 'JJeITB5wHxiohAquFYLMUee7awnFSNYpmqQDZiSYyvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)