UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8lW9Q+2a6Pqc9fnRI7DIQ2RLz8ZYl/pcQdIDU+2vvTc=' 
WHERE 
  key_id = '277ec8a651fb3c953758136271b46dbc7d6d19caa9dac390a0a0e4755dc16b60' 
  AND (
    token = '8lW9Q+2a6Pqc9fnRI7DIQ2RLz8ZYl/pcQdIDU+2vvTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025