UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v/QSLWlhXxR5lrl5jhFfH2E0omWonLJFwHM9nFne4bE='
WHERE
key_id = '24ce6cdc919b0a559646e64bdab472202a57c946e564ae035aaf4ff5db96799a'
AND (
token = 'v/QSLWlhXxR5lrl5jhFfH2E0omWonLJFwHM9nFne4bE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)