UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4+p3kb49+DgwytLFfc1uar5NRvbTgewz7mKxzycdMw0=' 
WHERE 
  key_id = '086dc5b2690a426bcd44ce987b92a40470ec3fc66020776e52e4c63f8650a892' 
  AND (
    token = '4+p3kb49+DgwytLFfc1uar5NRvbTgewz7mKxzycdMw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029