UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lf1Nw0hm6lYoQ9xSoOP9WQ8FSaadj1n0MCiKOQKgGsM=' 
WHERE 
  key_id = 'c0e52cbb23575f7c241e233610224cf8df19507b3f074dc83f5855f48ab0a0c1' 
  AND (
    token = 'Lf1Nw0hm6lYoQ9xSoOP9WQ8FSaadj1n0MCiKOQKgGsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016