UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2lWR1L+YdFG71trlXf5HRq96tYyd294tLIuCADu/zXc=' 
WHERE 
  key_id = '93d205697abe8be6f43071aedddaceddc282d0821603804528c12bcdd125dd37' 
  AND (
    token = '2lWR1L+YdFG71trlXf5HRq96tYyd294tLIuCADu/zXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029