UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5P1SyG/S6ouvkBEF9E6FBbb069Tc5uEj0sARz+7yKO8=' 
WHERE 
  key_id = 'fb6fb43ee1f7d7d9df29ec1a6f62fa5f9eca45602712584f00522014b8b54d23' 
  AND (
    token = '5P1SyG/S6ouvkBEF9E6FBbb069Tc5uEj0sARz+7yKO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019