UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h9oAeDEnsOdT5tKZyCG6z2rrTl/QiOQtCA3ndDyjLwI=' 
WHERE 
  key_id = '80bced66b417febc7ac1fe7034ceccdfce6aebad42506bdafa6ca962deded09f' 
  AND (
    token = 'h9oAeDEnsOdT5tKZyCG6z2rrTl/QiOQtCA3ndDyjLwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017