UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3UMk3k5adyOEaJHYpt5nX4VJnWkHtvpSAC08iSW7Pfo=' 
WHERE 
  key_id = '52abed4207f4502f02683e7c9ec6e78733229c299fc9bb0843fb8332171800e5' 
  AND (
    token = '3UMk3k5adyOEaJHYpt5nX4VJnWkHtvpSAC08iSW7Pfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017