UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ge373Kd9FmFdQTeKY+04r6ios87qKoKcaAaqfyQ8bFI=' 
WHERE 
  key_id = '38cb2bd8b27f44a64879a740c9b95539b9c08984eb3a6ceb400dfa843ccf2e19' 
  AND (
    token = 'ge373Kd9FmFdQTeKY+04r6ios87qKoKcaAaqfyQ8bFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016