UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQae+RIH8bJKfe8BrjO4kkU75V/xCzcGMqQPejF1buY='
WHERE
key_id = 'de66d59d30dfa161cc98edc9fc2f9e2dd58b3e7423e39349dee29af88d355bcd'
AND (
token = 'SQae+RIH8bJKfe8BrjO4kkU75V/xCzcGMqQPejF1buY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)