UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cBxoLL9Lncd+epeEx8wi5J1c0k3ZmIuidXqz8QWZ+5s='
WHERE
key_id = '0b8e148d1458d32e499b05d7c3c6b8dee1f7e9e9f7b7775ed4da79c774fd739c'
AND (
token = 'cBxoLL9Lncd+epeEx8wi5J1c0k3ZmIuidXqz8QWZ+5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)