UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ejgvxtug+IA07Bj7W/9UXRDHvbNHTgeq3KkgzeKKTQ4='
WHERE
key_id = 'ad711ce09647fca2100f0f119a9c382ef0a86204389c50683add7f6703a6946d'
AND (
token = 'ejgvxtug+IA07Bj7W/9UXRDHvbNHTgeq3KkgzeKKTQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)