UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AB8Lg0ctaZoq637CZZUNFYP1bhtbh3YGZb7M3c58mvE=' 
WHERE 
  key_id = '7cdba131db41feb84f11aae359ab6dc409479443d0e4a39b42307ba2657c872e' 
  AND (
    token = 'AB8Lg0ctaZoq637CZZUNFYP1bhtbh3YGZb7M3c58mvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045