UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+pOJHjRfWkZ71pCrJd0JThtb1ekihGaq5dgrY93JkTM=' 
WHERE 
  key_id = '42f146c43d64af1a2cb435881cd44f318506ab4ee70bf2cb5cfa3b9547dc6a87' 
  AND (
    token = '+pOJHjRfWkZ71pCrJd0JThtb1ekihGaq5dgrY93JkTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029