UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JfrUqQTGI23pi1kPovI/r7u/l0zBj1LD+7msZk2TQK8='
WHERE
key_id = '4cbc9368152b1da5599829b5e8fa336c9f4977691cd3bb8fba4eda2a32feeb0c'
AND (
token = 'JfrUqQTGI23pi1kPovI/r7u/l0zBj1LD+7msZk2TQK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)