UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2I/+UHebkI09WnoQcq9JkbOWoGhdmkPO8mbX/tfN/t8='
WHERE
key_id = '4a7cde6d30293296719bd8ba12f2324d5d6aeb2051619d6dbabae7ad7dace797'
AND (
token = '2I/+UHebkI09WnoQcq9JkbOWoGhdmkPO8mbX/tfN/t8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)