UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/4rcVHi7EqwGshvVr2hlauOYM/VtFtiAK1vu6Kdk/9g=' 
WHERE 
  key_id = 'a7d3016ce129bee4f2690785a13627e3d70562f748ef361c01e87088bd4da86d' 
  AND (
    token = '/4rcVHi7EqwGshvVr2hlauOYM/VtFtiAK1vu6Kdk/9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040