UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QSJRLqp9pUsAWAS6SeMbQmo0QZOFH/zJmuAe8RrVioM='
WHERE
key_id = '34da55eef27166d4ef4435431226424bdee703e176b55680c9a59280d0fe8940'
AND (
token = 'QSJRLqp9pUsAWAS6SeMbQmo0QZOFH/zJmuAe8RrVioM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)