UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZAoIjbpihggvpZhzvVswPb6dTnOdrzMdlxLkhH/YJ0=' 
WHERE 
  key_id = '35b385989a064d7b0d9b288e6ceb60a42b163e89d1ed17f27e2961cf5332b6e6' 
  AND (
    token = 'UZAoIjbpihggvpZhzvVswPb6dTnOdrzMdlxLkhH/YJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021