UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35UYOyZoF9BsLMf/E4wC2q/j+JQtfTnrP7a9sGOwTBw=' 
WHERE 
  key_id = '3dc150e190ad6ca8bd5994e608e273c4bfdeda1215cb686ce8d17b2470aadf98' 
  AND (
    token = '35UYOyZoF9BsLMf/E4wC2q/j+JQtfTnrP7a9sGOwTBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032