UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vix4EX9QKaDzqRfDJyZEP1X7hO9r7WLty+vDhYLKx4M='
WHERE
key_id = 'ab41514c816f6dcd15240438d3c79675d757d421d36d6044fbd9d51119be5565'
AND (
token = 'Vix4EX9QKaDzqRfDJyZEP1X7hO9r7WLty+vDhYLKx4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)